#ifndef __SPI_H__
#define __SPI_H__

#include <string.h>
#include <stdlib.h>
#include <stdio.h>



//*****************************************************************************
//
// If building with a C++ compiler, make all of the definitions in this header
// have a C binding.
//
//*****************************************************************************
#ifdef  __cplusplus
extern "C" {
#endif

typedef void (*gcSpiHandleRx)(void *p);
typedef void (*gcSpiHandleTx)(void);

extern unsigned char wlan_tx_buffer[];

//*****************************************************************************
//
// Prototypes for the APIs.
//
//*****************************************************************************
extern void SpiOpen(gcSpiHandleRx pfRxHandler);
extern void SpiClose(void);
extern long SpiWrite(unsigned char *pUserBuffer, unsigned short usLength);
extern long SpiFirstWrite(unsigned char *ucBuf, unsigned short usLength);
extern void SpiResumeSpi(void);
extern void SpiConfigureHwMapping(	unsigned long ulPioPortAddress,
									unsigned long ulPort, 
									unsigned long ulSpiCs, 
									unsigned long ulPortInt, 
									unsigned long uluDmaPort,
									unsigned long ulSsiPortAddress,
									unsigned long ulSsiTx,
									unsigned long ulSsiRx,
									unsigned long ulSsiClck);
extern void SpiCleanGPIOISR(void);

//*****************************************************************************
//
// Mark the end of the C bindings section for C++ compilers.
//
//*****************************************************************************
#ifdef  __cplusplus
}
#endif // __cplusplus

#endif

